package cn.com.dhc.danlu.business.shopcar.bean;

import java.util.ArrayList;
import java.util.List;

import cn.com.dhc.danlu.business.shopcar.typefactory.IShopCarTypeFactory;

/**
 * author: 李一方(<a href="mailto:liyifang@danlu.com">liyifang@danlu.com</a>)<br/>
 * version: 1.0.0<br/>
 * since: 2017-02-27 16:58
 *
 * <p>
 * 商家信息区域
 * </p>
 */
public class SellerBean extends ShopCarItem {
    // 增补信息区域
    /**
     * 促销 UI index
     */
    private int promotionIndex;
    /**
     * 商品 UI index
     */
    private List<Integer> merchIndex;

    // 商家实际字段区域
    private String sellerId;
    private String sellerName;
    private String isYijipayAccount;
    private String paymentFlag;
    private String codFlag;
    private String supportCod;
    private String supportVatInvoice;
    private String minDeliveryAmt;

    @Override
    public int type(IShopCarTypeFactory factory) {
        return factory.type(this);
    }

    // 增补信息区
    public List<Integer> getMerchIndex() {
        if (null == merchIndex) {
            merchIndex = new ArrayList<>();
        }

        return merchIndex;
    }

    public void setMerchIndex(List<Integer> merchIndex) {
        this.merchIndex = merchIndex;
    }

    public int getPromotionIndex() {
        return promotionIndex;
    }

    public void setPromotionIndex(int promotionIndex) {
        this.promotionIndex = promotionIndex;
    }

    // 实际字段区
    public boolean hasPromotionArea() {
        return promotionIndex != 0;
    }

    public String getSellerId() {
        return sellerId;
    }

    public void setSellerId(String sellerId) {
        this.sellerId = sellerId;
    }

    public String getSellerName() {
        return sellerName;
    }

    public void setSellerName(String sellerName) {
        this.sellerName = sellerName;
    }

    public String getIsYijipayAccount() {
        return isYijipayAccount;
    }

    public void setIsYijipayAccount(String isYijipayAccount) {
        this.isYijipayAccount = isYijipayAccount;
    }

    public String getPaymentFlag() {
        return paymentFlag;
    }

    public void setPaymentFlag(String paymentFlag) {
        this.paymentFlag = paymentFlag;
    }

    public String getCodFlag() {
        return codFlag;
    }

    public void setCodFlag(String codFlag) {
        this.codFlag = codFlag;
    }

    public String getSupportCod() {
        return supportCod;
    }

    public void setSupportCod(String supportCod) {
        this.supportCod = supportCod;
    }

    public String getSupportVatInvoice() {
        return supportVatInvoice;
    }

    public void setSupportVatInvoice(String supportVatInvoice) {
        this.supportVatInvoice = supportVatInvoice;
    }

    public String getMinDeliveryAmt() {
        return minDeliveryAmt;
    }

    public void setMinDeliveryAmt(String minDeliveryAmt) {
        this.minDeliveryAmt = minDeliveryAmt;
    }
}
